package cn.com.db.dao;

import cn.com.db.model.Order;
import cn.com.db.model.Store;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

@Component
@Mapper
public interface OrderDao {
    void createOrder(Order order);

    Order getOrderById(@Param("id") String id);

    List<Order> getOrder(@Param("order")Order order,
                         @Param("start")Timestamp start,
                         @Param("end")Timestamp end,
                         @Param("rowStart")Integer rowStart,
                         @Param("pageSize")Integer pageSize);

    Integer countOrder(@Param("order")Order order,
                       @Param("start")Timestamp start,
                       @Param("end")Timestamp end);

    Integer getDealPeopleNum(@Param("sellerId")String sellerId,
                             @Param("storeId")String storeId,
                             @Param("confirm")Integer confirm);

    Integer getOrderNum(@Param("sellerId")String sellerId,
                        @Param("storeId")String storeId,
                        @Param("confirm")Integer confirm);

    BigDecimal getTurnover(@Param("sellerId")String sellerId,
                           @Param("storeId")String storeId,
                           @Param("confirm")Integer confirm);

    BigDecimal getTodayTurnover(@Param("sellerId")String sellerId,
                                @Param("storeId")String storeId,
                                @Param("todayStart")Timestamp todayStart,
                                @Param("todayEnd")Timestamp todayEnd,
                                @Param("confirm")Integer confirm);

    void updateOrderStatus(@Param("id")String orderId,
                          @Param("status")Integer status);

    void cancel(@Param("id")String id);

    void confirm(@Param("id")String id,
                 @Param("status")Integer status);
    
    List<Order> getOrderByIdList(@Param("list")List<String> orderIds);

}
